#include <stdio.h>

void func(int *a, int *b) {
    int temp;
    temp = *a;
    *a = *b;
    *b = temp;
}

int main() {
    int x = 1, y = 2;
    int *p, *q;
    p = &x;
    q = &y;
    printf("x=%d, y=%d\n\n", x, y);
    func(p, q);
    printf("x=%d, y=%d\n", x, y);
    printf("x=%d, y=%d\n", *p, *q);
    return 0;
}